

 function idnumberIsValid(idnumber){
    let idcardReg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/
    return idcardReg.test(idnumber);
  }
  
  function mobileIsValid(phone){
    // const phoneReg = new RegExp("/^[1][3,4,5,6.7,8,9][0-9]{9}$/")
    const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
    return phoneReg.test(phone)
  
  }


  function toNext(){
      const returnUrl =getReturnUrl();
      if(returnUrl){
        clearReturnUrl();
        location.href=returnUrl;
      }
  }

//url = D:\tongkunapi\Images\3e644967-2b70-4c02-b57a-eac297fe8675.jpg
 function getTmpImgUrl(url){
   const arr = url.split("\\");
   const last = arr[arr.length-1];
   return `https://khxtpt.zjtkgf.com/img/${last}`
 }

/**
 * 
 * @param {*} data 
 * @param {*} title 
 * @param {*} url 
 * @param {*} type replace \ push
 */
 function navigateTo(url,type,data,title){
   
  if(type == "push"){
    // history.pushState(data,title,url);
    location.href=url;
  }else if(type == "replace"){
    location.replace(url)
  }

  return;
  if(type == "replace"){
    console.log('before replace ',history.length)
    // history.replaceState(data,title,url);
    setTimeout(() => {
      
      location.replace(url);  
    }, 2000);
    console.log("延迟两秒跳转")
    console.log('after replace ',history.length)
  }else{
    console.log('before push ',history.length)
    // history.pushState(data,title,url);
    setTimeout(() => {
      
      location.href=url;  
    }, 2000);
    console.log("延迟两秒跳转")
    console.log('after push ',history.length)
  }
  
 }